package t10086.Data.Map;

import java.io.Serializable;

public class T10086Map implements Serializable {
     private MapGrid[][] grids;//地图
     private int rows;//行数
     private int columns;//列数
     public T10086Map(){}
     public T10086Map(int rows, int columns) {
         this.rows = rows;
         this.columns = columns;
         grids = new MapGrid[rows][columns];
         for (int row = 0; row < this.rows; row++) {
             for (int column = 0; column < this.columns; column++) {
                 grids[row][column] = new MapGrid();
             }
         }
      }
     public T10086Map(MapGrid[][] grids) {
         this.grids = grids;
         rows = grids.length;
         columns = grids[0].length;
     }
     public  MapGrid  getGrid(TextCoordinate textCoordinate){
         return grids[textCoordinate.x][textCoordinate.y];
     }
     public  MapGrid getGrid(int row, int column) {
         return grids[row][column];
     }
     public void setGrid(int row, int column, MapGrid grid) {
         grids[row][column] = grid;
     }

     public MapGrid[][] getGrids() {
        return grids;
    }

     public void setGrids(MapGrid[][] grids) {
        this.grids = grids;
    }

     public int getRows() {
        return rows;
    }

     public void setRows(int rows) {
        this.rows = rows;
    }

     public int getColumns() {
        return columns;
    }

     public void setColumns(int columns) {
        this.columns = columns;
    }
}
